#pragma once
#include "Vector3.h"

namespace lib3dw 
{
	struct Matrix3x3
	{
		Vector3 rows[3];

		Matrix3x3()
		{

		}

		Matrix3x3(const Vector3 &row0, const Vector3 &row1, const Vector3 &row2)
		{
			rows[0] = row0;
			rows[1] = row1;
			rows[2] = row2;
		}

		Matrix3x3(const float m00, const float m01, const float m02,
			const float m10, const float m11, const float m12,
			const float m20, const float m21, const float m22)
		{
			rows[0] = Vector3(m00, m01, m02);
			rows[1] = Vector3(m10, m11, m12);
			rows[2] = Vector3(m20, m21, m22);
		}

		operator const float *() const
		{
			return (const float *) rows;
		}
	};

	Matrix3x3 operator + (const Matrix3x3 &m, const Matrix3x3 &n);
	Matrix3x3 operator - (const Matrix3x3 &m, const Matrix3x3 &n);
	Matrix3x3 operator - (const Matrix3x3 &m);
	Matrix3x3 operator * (const Matrix3x3 &m, const Matrix3x3 &n);
	Vector3 operator * (const Matrix3x3 &m, const Vector3 &v);
	Matrix3x3 operator * (const Matrix3x3 &m, const float x);
	Matrix3x3 transpose(const Matrix3x3 &m);
	float det(const Matrix3x3 &m);
}
